//
//  operatorVC.swift
//  swiftDemo
//
//  Created by yaqiang bi on 2017/3/7.
//  Copyright © 2017年 毕小强. All rights reserved.
//

import UIKit

class operatorVC: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        self.view.backgroundColor = UIColor.white
        // Do any additional setup after loading the view.
        
        
        /// 三元条件运算符
        let height = ((50>30) ? 50:30)
        print("\(height)更大一点")
        
        
        /// 合并控制运算符 optionalValue有值则展开 为nil 则返回默认值someValue
        let optionalValue :String? = nil
        let someValue :String = "再次算什么呢"
        print(optionalValue ?? someValue)
        
        
        ///区间运算符
        for index in 0...5 {
            ///闭区间运算符 两边包含
            print("闭区间运算符:\(index)")
        }
        
        for index in 5..<10 {
            ///半开区间运算符 左边包含
            print("半开区间运算符:\(index)")
        }
        
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}
